package com.sc.servlet.admin.fieldbook;

import com.sc.pojo.Comment;
import com.sc.services.UserServices;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @description: 通过预约审批 修改预约状态
 * @author: sc
 * @create: 2023-01-05 11:49
 **/
@WebServlet("/accessBookField")
public class accessBookFieldServlet extends HttpServlet {

    private UserServices userServices = new UserServices();

    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {


        String accessBookField = request.getParameter("fieldbookid");
        userServices.updateBookState(accessBookField);

        response.setContentType("text/json;charset=utf-8");
        response.getWriter().write("access_suc");


    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        this.doGet(request, response);
    }
}